import React from 'react';
import {
    Scene,
    Router,
    Lightbox
} from 'react-native-router-flux';

import WelcomeScreen from "../screen/WelcomeScreen"
import MainScreen from "../screen/MainScreen";

import BackUtils from "../utils/BackUtils"

/**
 * 全局路由
 */
const getRouter = () => {
    return (
        <Router
            backAndroidHandler={
                BackUtils()}>
            <Lightbox>
                <Scene key="root"
                       titleStyle={{color: "#333333"}}>
                    <Scene key="WelcomePage">
                        <Scene key="WelcomePage" component={WelcomeScreen} hideNavBar hideTabBar hide/>
                    </Scene>
                    <Scene key="MainScreen">
                        <Scene key="MainScreen" component={MainScreen} hideNavBar hideTabBar hide/>
                    </Scene>
                </Scene>
            </Lightbox>
        </Router>
    )
};

export default getRouter;